Imports System
Imports ValidationFramework


Public Class DateTimeConversionRuleAttributeExample
    ' Methods
    Public Sub ParseDateTime( _
    <DateTimeConversionRule()> ByVal decimalString As String)
        ParameterValidationManager.ThrowException(Me, doSomethingHandle, decimalString)
    End Sub


    ' Properties
    <DateTimeConversionRule(ErrorMessage:="Invalid decimal format.")> _
    Public Property DateTimeString() As String
        Get
            Return _dateTimeString
        End Get
        Set(ByVal value As String)
            _dateTimeString = value
        End Set
    End Property


    ' Fields
    Private _dateTimeString As String
    Private Shared ReadOnly doSomethingHandle As RuntimeMethodHandle = _
    GetType(DateTimeConversionRuleAttributeExample).GetMethod("ParseDateTime").MethodHandle
End Class

